package com.buba.system.controller;

import com.buba.system.pojo.Menu;
import com.buba.system.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 系统结构控制层
 */
@Controller
@RequestMapping("/Menu")
public class MenuController {
    private MenuService menuService;

    @RequestMapping("/selMenu.do")
    @ResponseBody
    public Map<String,Object> selMenu(Integer pid){
        Map<String,Object> map = new HashMap<>();
        List<Menu> list = menuService.selMenu(pid);
        map.put("data",list);
        return map;
    }


    public MenuService getMenuService() {
        return menuService;
    }
    @Autowired
    public void setMenuService(MenuService menuService) {
        this.menuService = menuService;
    }
}
